package com.ideheima.zuoye.zuoye5;

import java.util.StringJoiner;

public class Test {


    public static void Sb() {
        long start = System.currentTimeMillis();
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < 1000000; i++) {
            sb.append("kunkun");
        }
        long end = System.currentTimeMillis();
        //System.out.println(sb);
        System.out.println("执行时间：" + (end - start) / 10000.0 + "s");

    }

    public static void Sj() {
        long start = System.currentTimeMillis();
        StringJoiner sj = new StringJoiner(",");
        for (int i = 0; i < 1000000; i++) {
            sj.add("kunkun");
        }
        long end = System.currentTimeMillis();
        // System.out.println(sj);
        System.out.println("执行时间：" + (end - start) / 10000.0 + "s");
    }

    public static void main(String[] args) {
        Sb();
        Sj();
    }
}
